package cyy.example.com.facotry.model.api.response;

import android.os.Parcel;
import android.os.Parcelable;

import com.example.com.common.widget.diffui.DiffUiDataCallBack;

import java.util.List;

/**
 * @author ChenYiYao
 * @date 2018/5/14
 * des :
 */
public class TaskInfoEntity {

    /**
     * count : 2
     * ob : [{"taskName":"xxx任务","taskStatu;":1,"taskType":3,"companyName":"xxx公司","longitude":"12.34","latitude":"17.56","beginTime":"2018-12-21","endTime":"2018-12-23"},{"taskName":"xxx任务2","taskStatu;":1,"taskType":3,"companyName":"xxx公司2","longitude":"12.34","latitude":"17.56","beginTime":"2018-12-21","endTime":"2018-12-23"}]
     */

    private int count;
    private List<ObBean> ob;

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<ObBean> getOb() {
        return ob;
    }

    public void setOb(List<ObBean> ob) {
        this.ob = ob;
    }

    public static class ObBean implements DiffUiDataCallBack.UidataDiffer<ObBean>, Parcelable {
        /**
         * taskName : xxx任务
         * taskStatu; : 1
         * taskType : 3
         * companyName : xxx公司
         * longitude : 12.34
         * latitude : 17.56
         * beginTime : 2018-12-21
         * endTime : 2018-12-23
         */

        private String taskName;
        private String taskStatu;
        private String taskType;
        private String taskTypeDesc;
        private String companyName;
        private String longitude;
        private String latitude;
        private String beginTime;
        private String endTime;
        private String taskId;
        private String taskContents;
        private String companyId;
        private String fromId;
        private String taskNumber;
        private String uploadForm;
        private int operatorType;  // 0-派发人;1-接收人;2-超管

        public int getOperatorType() {
            return operatorType;
        }

        public void setOperatorType(int operatorType) {
            this.operatorType = operatorType;
        }

        public String getUploadForm() {
            return uploadForm;
        }

        public void setUploadForm(String uploadForm) {
            this.uploadForm = uploadForm;
        }

        public String getTaskId() {
            return taskId;
        }

        public void setTaskId(String taskId) {
            this.taskId = taskId;
        }

        public String getTaskContents() {
            return taskContents;
        }

        public void setTaskContents(String taskContents) {
            this.taskContents = taskContents;
        }

        public String getCompanyId() {
            return companyId;
        }

        public void setCompanyId(String companyId) {
            this.companyId = companyId;
        }

        public String getTaskName() {
            return taskName;
        }

        public void setTaskName(String taskName) {
            this.taskName = taskName;
        }

        public String getTaskStatu() {
            return taskStatu;
        }

        public void setTaskStatu(String taskStatu) {
            this.taskStatu = taskStatu;
        }

        public String getTaskType() {
            return taskType;
        }

        public void setTaskType(String taskType) {
            this.taskType = taskType;
        }

        public String getCompanyName() {
            return companyName;
        }

        public void setCompanyName(String companyName) {
            this.companyName = companyName;
        }

        public String getLongitude() {
            return longitude;
        }

        public void setLongitude(String longitude) {
            this.longitude = longitude;
        }

        public String getLatitude() {
            return latitude;
        }

        public void setLatitude(String latitude) {
            this.latitude = latitude;
        }

        public String getBeginTime() {
            return beginTime;
        }

        public void setBeginTime(String beginTime) {
            this.beginTime = beginTime;
        }

        public String getEndTime() {
            return endTime;
        }

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }

        public String getFromId() {
            return fromId;
        }

        public void setFromId(String fromId) {
            this.fromId = fromId;
        }

        public String getTaskNumber() {
            return taskNumber;
        }

        public void setTaskNumber(String taskNumber) {
            this.taskNumber = taskNumber;
        }

        public String getTaskTypeDesc() {
            return taskTypeDesc;
        }

        public void setTaskTypeDesc(String taskTypeDesc) {
            this.taskTypeDesc = taskTypeDesc;
        }

        @Override
        public boolean isSame(ObBean old) {
            return taskId.equals(old.taskId);
        }

        @Override
        public boolean isDataContentSame(ObBean old) {
            return taskStatu.equals(old.taskStatu) && taskType.equals(old.taskType)
                    && companyName.equals(old.companyName);
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.taskName);
            dest.writeString(this.taskStatu);
            dest.writeString(this.taskType);
            dest.writeString(this.taskTypeDesc);
            dest.writeString(this.companyName);
            dest.writeString(this.longitude);
            dest.writeString(this.latitude);
            dest.writeString(this.beginTime);
            dest.writeString(this.endTime);
            dest.writeString(this.taskId);
            dest.writeString(this.taskContents);
            dest.writeString(this.companyId);
            dest.writeString(this.fromId);
            dest.writeString(this.taskNumber);
            dest.writeString(this.uploadForm);
        }

        public ObBean() {
        }

        protected ObBean(Parcel in) {
            this.taskName = in.readString();
            this.taskStatu = in.readString();
            this.taskType = in.readString();
            this.taskTypeDesc = in.readString();
            this.companyName = in.readString();
            this.longitude = in.readString();
            this.latitude = in.readString();
            this.beginTime = in.readString();
            this.endTime = in.readString();
            this.taskId = in.readString();
            this.taskContents = in.readString();
            this.companyId = in.readString();
            this.fromId = in.readString();
            this.taskNumber = in.readString();
            this.uploadForm = in.readString();
        }

        public static final Parcelable.Creator<ObBean> CREATOR = new Parcelable.Creator<ObBean>() {
            @Override
            public ObBean createFromParcel(Parcel source) {
                return new ObBean(source);
            }

            @Override
            public ObBean[] newArray(int size) {
                return new ObBean[size];
            }
        };
    }
}
